import React from "react";
import { List } from "antd-mobile";
import { http } from "@/utils/request/index.js";
import api from "@/utils/api.js";
import "./index.less";
const Item = List.Item;
class Record extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      lists : []
    };
  }

  componentWillMount() {
    http.post(api.getListForWeixin).then((res) => {
      this.setState({
        lists: res.data,
      });
    });
  }

  render() {
    return (
      <div className="record">
        {this.state.lists.length ? (
          <List>
            {this.state.lists.map((item) => {
              return (
                <Item onClick={() => {}} extra={'+ ' + item.amount}>
                  <div className="col-595959">
                    {item.inBankName} 尾号{item.inUserIdCard.substring(item.inUserIdCard.length - 4)}
                  </div>
                  <div className="col-8C8C8C ft-12">{item.createDate}</div>
                </Item>
              );
            })}
          </List>
        ) : (
          <div className="text-center" style={{ marginTop: "7rem" }}>
            <img
              style={{ width: "3rem" }}
              src={require("../../../images/mine/noRecord.png")}
            />
            <p className="ft-13 color-8C8C8C">暂无数据</p>
          </div>
        )}
      </div>
    );
  }
}

export default Record;
